Known to the inventor, which is depicted in FIG. 1, is a computing environment for executing executable code including a computer program programmed loop having related instructions. The computing environment includes computer system 112 having CPU (Central Processing Unit) 116 and memory 114 operatively connected to CPU 116.
Memory 114 stores source code 100, compiler 118, executable code 120, and memory storage locations 122. Typically, compiler 118 and source code 100 reside or are stored in long-term memory (not depicted) such as a hard disk or a floppy disk. As directed by a user, CPU 116 transfers compiler 118 and source code 100 from long-term memory to memory 114. Once transferred to memory 114, compiler 118 instructs CPU 116 to compile source code 100 to generate executable code 120. Typically, memory 114 is RAM (Random Access Memory).
Source code 100 includes computer programmed instructions written in a computer programming language. Instructions forming source code 100 are used for instructing CPU 116 to achieve or perform specific tasks. Source code 100 includes start instructions 102 for starting operations of CPU 116, set of instructions 104 (which will be executed once by CPU 116), computer programmed loop 105 having instructions 106 (which will be repeatedly executed “N−1” times by CPU 116) for computing numerical values of various array elements, and stop instructions 110 for stopping execution of source code 100.
Executable code 120 includes executable instructions related to loop 105 for instructing or directing CPU 116 to compute numerical values for the elements of array A[1], A[2], A [3], . . . , A[N−1], provided that a numerical value for array element A[0] exists prior to the commencement of computation. When CPU 116 executes executable code 120, the compiled instructions related to block 102 are initially executed, followed by the execution of the compiled instructions related to block 104 and block 105, and then followed by the execution of the compiled instructions of block 110. CPU 116 will repetitively execute the compiled instructions of computer programmed loop 105 for a predetermined number of executions. For each iterative step of a computer programmed loop, a numerical value of an array element (such as A[i]) is computed by CPU 116 which then will store the computed numerical value to a memory storage location 122 (before CPU computes another numerical value for another array element).
A computer programmed loop is a series of instructions which are performed repeatedly until some specific condition is satisfied, whereupon a branch instruction is obeyed to exit from the computer programmed loop. The branch instruction specifies the address of the next instruction to be performed by a CPU. Computer programmed loop 105 includes instructions for repeated execution by CPU 116. Computer programmed loops are also known as strongly connected regions. Computer programmed loop 105 includes an induction variable (depicted as “i”) which has a related induction value that changes for each iterated or repeated step of computer programmed loop 105. For each iterated step of computer programmed loop 105, the induction value is changed in a predetermined manner, such as adding a numerical value of ‘1’ to a current induction value related to a current iterated step. As shown in FIG. 1, for each iterative step of the computer programmed loop, computation 106 will be performed by CPU 116 in which a value for an array element A[i] in block 107 will be computed by adding the value of a previously computed array element A[i−1] plus the numerical value of “1”. The computational task is depicted in block 108. Typically, the changed induction value is subsequently used in a next iterative step for modifying the instructions related to the next iterated step. Computer programmed loop 105 provides a convenient way to avoid repeatedly expressing repetitive instructions by expressing the instructions once. It is understood that CPU 116 will repeatedly execute the instructions of computer programmed loop ‘N−1’ times. This conveniently allows a software programmer to avoid explicitly writing the instructions ‘N−1’ times. Disadvantageously, a significant amount of CPU processing time will be spent executing the compiled instructions of computer programmed loop 105.
It will be understood that for each iterative step of computer programmed loop 105, executable code 120 instructs CPU 116 to obtain (load/read) a value of an array element A[i−1] from a specific location in memory storage locations 122, to add a numerical value of “1” to array element A[i−1], and to place (store/write) the computational result (that is array element A[i]) to another specific location in memory storage location 122. Disadvantageously, computer programmed loop 105 requires, with each iterative step of an induction variable, CPU 116 to load/read various recurrence elements from main memory, compute a value for a primary recurrence element, and then store/write the primary recurrence element to the main memory (such as locations 122). Recurrence elements are values which are re-computed for each iterative step of a computation process. An example of a computation process which re-computes values of recurrence elements is a computer programmed loop which computes various array elements (which act like recurrence elements) for each step of the loop. This is an inefficient system for computing or processing values (such as numerical data or alphanumeric data) associated with a computer programmed loop because time is wasted when the CPU interacts with slow operating memory when performing a multitude of load/read or store/write operations for each iterative step of the computer programmed loop. Additionally, if storage locations 122 are storage locations in nonvolatile memory (that is not RAM), the effects are exaggerated.
Accordingly, a system which addresses, at least in part, these and other shortcomings is desired.